package host.skiree.domain;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

public class A implements InitializingBean , DisposableBean {

    public A(){
        System.out.println("constructor");
    }

    @PostConstruct
    public void postConstruct(){
        System.out.println("@postConstruct");
    }

    //InitializingBean接口的方法afterPropertiesSet
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("afterPropertiesSet");
    }

    //MainConfig中@Bean 的initMethod
    public void initMethod(){
        System.out.println("initMethod");
    }


    @PreDestroy
    public void preDestroy(){
        System.out.println("@preDestroy");
    }

    //DisposableBean接口的方法destroy
    @Override
    public void destroy() throws Exception {
        System.out.println("destroy");
    }

    //MainConfig中@Bean 的destroyMethod
    public void destroyMethod(){
        System.out.println("destroyMethod");
    }

}